<template>

        <tr>
          <td>
            <input type="checkbox" />
          </td>
          <td>{{sname}}</td>
          <td>{{sprice}}</td>
          <td>
            <button @click="add">+</button>
            {{snum}}
            <button @click.prevent="sub">-</button>
            </td>
          <td>{{scount}}</td>
          <td>
            <button @click="chuan">删除</button>
          </td>
        </tr>

</template>

<script>
export default {
  props: ['sindex', 'sname', 'sprice', 'snum', 'schecked'],
  methods: {
    add () {
      this.snum++
    },
    sub () {
      this.snum--
    },
    chuan () {
      this.$emit('del', 'sindex')
    }
  },
  computed: {
    scount () {
      return this.snum * this.sprice
    }
  }
}
</script>

<style>
</style>
